import axios from '@/utils/request.js'

// 获取所有频道列表
export const getAllChannels = () => {
    return axios({
        url: '/v1_0/channels'
    })
}

// 新增用户频道
// usrChannel->{id,seq}
export const addUsrChannel = (usrChannel) => {
    return axios({
        method: 'patch',
        url: '/v1_0/user/channels',
        data: {
            channels: [usrChannel]
        }
    })
}

export const removeUsrChannel = (chanId) => {
    return axios({
        method: 'delete',
        url: `/v1_0/user/channels/${chanId}`,
    })
}